import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import AutoImport from 'unplugin-auto-import/vite'
import path from 'path'
import viteCompression from 'vite-plugin-compression'

export default defineConfig({
	plugins: [
		vue(),
		viteCompression(),
		Components({
			resolvers: [NaiveUiResolver()],
		}),
		AutoImport({
			imports: ['vue', 'vue-router', 'pinia'],
			resolvers: [NaiveUiResolver()],
		}),
	],
	resolve: { // 设置项目文件导入路径
		alias: {
			'@': path.resolve(__dirname, './src'),
		},
	},
})
